package com.hebeiboruan.entity.system;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hebeiboruan.entity.DTO.system.RegisterUser;

import java.io.Serializable;
import java.util.Date;

/**
 * @author 刘焕林
 * @date 2023/11/02
 */
@TableName("br_user")
public class User implements Serializable {
    @TableId(value = "user_no",type = IdType.AUTO)
    @ExcelProperty(value = "用户编号")
    private Integer userNo;
    @TableField("user_account")
    @ExcelProperty(value = "账号")
    private String userAccount;
    @TableField("user_password")
    @ExcelProperty(value = "密码")
    private String userPassword;
    @TableField("user_name")
    @ExcelProperty(value = "用户名")
    private String userName;
    @TableField("user_phone")
    @ExcelProperty(value = "联系方式")
    private String userPhone;
    @TableField("user_email")
    @ExcelProperty(value = "邮箱")
    private String userEmail;
    @TableField("user_ip")
    @ExcelProperty(value = "登录ip")
    private String userIp;
    @TableField("user_login_date")
    @ExcelProperty(value = "最后一次登录时间")
    private String userLoginDate;

    public String getUserIp() {
        return userIp;
    }

    public void setUserIp(String userIp) {
        this.userIp = userIp;
    }

    public String getUserLoginDate() {
        return userLoginDate;
    }

    public void setUserLoginDate(String userLoginDate) {
        this.userLoginDate = userLoginDate;
    }

    public User() {
    }
    public User(RegisterUser registerUser) {
        this.userEmail=registerUser.getUser_email();
        this.userAccount=registerUser.getAccount();
        this.userPassword=registerUser.getUserPassword();
        this.userPhone=registerUser.getUserPhone();
        this.userLoginDate="now()";
    }

    public User(Integer userNo, String userAccount, String userPassword, String userName, String userPhone, String user_email) {
        this.userNo = userNo;
        this.userAccount = userAccount;
        this.userPassword = userPassword;
        this.userName = userName;
        this.userPhone = userPhone;
        this.userEmail = user_email;
    }

    public Integer getUserNo() {
        return userNo;
    }

    public void setUserNo(Integer userNo) {
        this.userNo = userNo;
    }

    public String getUserAccount() {
        return userAccount;
    }

    public void setUserAccount(String userAccount) {
        this.userAccount = userAccount;
    }

    public String getUserPassword() {
        return userPassword;
    }

    public void setUserPassword(String userPassword) {
        this.userPassword = userPassword;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserPhone() {
        return userPhone;
    }

    public void setUserPhone(String userPhone) {
        this.userPhone = userPhone;
    }

    public String getUserEmail() {
        return userEmail;
    }

    public void setUserEmail(String userEmail) {
        this.userEmail = userEmail;
    }
}
